package com.fhzn.auth.constant;

import java.util.Arrays;
import java.util.List;

/**
 * @author fhzn
 */
public class Constants {

    public static final String AUTH_APP_CODE = "WUPS";

    public static final int USER_TYPE_INNER = 1;

    public static final int USER_TYPE_OUTERSOURCE = 2;

    public static final String APPLICATION_NAME = "backend-auth-new";

    public static final String OPERATE_TYPE_ADD = "add";

    public static final String OPERATE_TYPE_UPDATE = "update";

    /**
     * 启用
     */
    public static final int ENABLE = 1;

    /**
     * 禁用
     */
    public static final int DISABLE = 2;

    /**
     * 密码超期，需重置
     */
    public static final int PASSWORD_EXPIRED = 1;

    /**
     * 密码未超期，不需要重置
     */
    public static final int PASSWORD_NOT_EXPIRED = 0;

    /**
     * 系统MD5密钥
     */
    public static final String MD5_SECRET_KEY = "wacaikuaidai";

    /*********************************************************************************************************/

    /**
     * 有管理员权限的用户
     */
    public static List<String> USER_CAN_ADD_WBUSER = Arrays.asList("WBshuanghun", "WBgongbu", "WBxiangzun", "WBkashi", "WBdaiya", "WBbaoshilong");

    /**
     * 外部用户管理员
     */
    public static final String RLOE_AUTH_EXTERNAL_ADMIN = "AUTH_EXTERNAL_ADMIN";

    /**
     * 催收外部密码管理员
     */
    public static final String ROLE_CUISHOU_WB_PASS_ADMIN = "CUISHOU_WB_PASS_ADMIN";


    /*********************************************************************************************************/

    /**
     * 外包用户密码操作
     */
    public static final String USER_PASSWORD_UPDATE = "update";

    public static final String USER_PASSWORD_SEARCH = "search";

    /**
     * 批量发送用户初始密码到开关
     */
    public static boolean switchOpen = false;


    public static final String MANCAI_SYS_OPERATOR = "MANCAI";

    /***************************************  操作日志  ******************************************************************/

    /**
     * 用户
     */
    public static final String UESR_SECTION = "用户";
    public static final String UESR_ADD_METHOD = "添加用户";
    public static final String UESR_REG_METHOD = "用户注册";
    public static final String UESR_REG_APPROVE_PASS_METHOD = "用户注册审批通过";
    public static final String UESR_REG_APPROVE_REJ_METHOD = "用户注册审批拒绝";
    public static final String UESR_UPDATE_METHOD = "更新用户";
    public static final String USER_UPDATE_DYNAMIC_DISABLE = "动态禁用用户";
    public static final String USER_CONFIG_ROLES_ASSIGN = "修改用户角色分配";
    public static final String USER_PASSWORD_MODIFY_LOG = "修改用户密码";
    public static final String USER_PASSWORD_RESET_LOG = "重置用户密码";
    public static final String USER_PASSWORD_SEARCH_LOG = "查询用户密码";
    public static final String USER_GROUP_NAME = "默认组名";
    public static final String UESR_ROLE_APPLY_METHOD = "用户权限申请";
    public static final String UESR_ROLE_APPLY_APPROVE_PASS_METHOD = "用户权限申请审批通过";
    public static final String UESR_ROLE_APPLY_APPROVE_REJ_METHOD = "用户权限申请审批拒绝";


    /**
     * 角色
     */
    public static final String ROLE_SECTION = "角色";
    public static final String ROLE_ADD_METHOD = "添加角色";
    public static final String ROLE_ADD_WITH_RESOURCES_METHOD = "添加角色并绑定资源";

    public static final String ROLE_UPDATE_METHOD = "更新角色";
    public static final String ROLE_CONFIG_RESOURCES_ASSIGN = "修改角色权限分配";

    public static final String ROLE_RESOURCES_UPDATE_METHOD = "更新角色以及资源";
    public static final String ROLE_CONFIG_RESOURCES_DYNAMIC_ADD = "动态增添角色权限分配";
    public static final String ROLE_CONFIG_APPOINTS = "修改角色上下级";
    public static final String ROLE_DYNAMIC_ADD_METHOD = "动态添加角色";
    public static final String ROLE_ADD_USER_METHOD = "角色批量添加用户";
    public static final String ROLE_DEL_USER_METHOD = "角色批量删除用户";

    /**
     * 资源
     */
    public static final String RESOURCE_SECTION = "资源";
    public static final String RESOURCE_ADD_METHOD = "添加资源";
    public static final String RESOURCE_UPDATE_METHOD = "更新资源";
    public static final String RESOURCE_DYNAMIC_ADD = "动态添加资源";
    public static final String RESOURCE_DYNAMIC_UPDATE = "动态修改资源";

    public static final String DATA_RESOURCE_DYNAMIC_UPDATE = "动态修改数据权限资源";
    public static final String DATA_RESOURCE_ADD_METHOD = "添加数据权限资源";
    public static final String DATA_RESOURCE_DELETE_METHOD = "删除数据权限资源";
    public static final String DATA_RESOURCE_DISABLE_METHOD = "禁用数据权限资源";
    public static final String DATA_RESOURCE_ENABLE_METHOD = "启用数据权限资源";

    public static final String DATA_USER_RESOURCE_ADD_METHOD = "添加用户数据权限";
    public static final String DATA_USER_RESOURCE_DELETE_METHOD = "删除用户数据权限";

    public static final String DATA_RESOURCE_SYNC_METHOD = "数据资源同步";
    public static final String DATA_RESOURCE_EXPORT_METHOD = "数据资源导出";
    public static final String DATA_RESOURCE_IMPORT_METHOD = "数据资源导入";


    /**
     * 客户
     */
    public static final String CUSTOMER_SECTION = "客户";
    public static final String CUSTOMER_ADD_METHOD = "增加客户";
    public static final String CUSTOMER_UPDATE_METHOD = "更新客户";


    /**
     * 应用
     */
    public static final String APPLICATION_SECTION = "应用";
    public static final String APPLICATION_ADD_METHOD = "添加应用";
    public static final String APPLICATION_MESSAGE_UPDATE = "更新应用信息";

    /**
     * 岗位
     */
    public static final String STATION_SECTION = "岗位";
    public static final String STATION_ADD_METHOD = "添加岗位";
    public static final String STATION_MESSAGE_UPDATE = "更新岗位信息";

    public static final String GROUP_SECTION = "群组";
    public static final String GROUP_DELETE_METHOD = "删除群组";


    public static final String DYNAMIC_CONFIG_MODULE = "WUPS";
    public static final String DYNAMIC_CONFIG_SUB_MODULE = "WUPS_DYNAMIC";
    public static final String DYNAMIC_CONFIG_APPCODE_KEY = "SUPPORTED_APP_CODES";
    public static final String DYNAMIC_CONFIG_USER_ROLE_APP_ROLE_PREFIX = "SUPPORTED_ROLE_PREFIX_FOR_";
    public static final String DYNAMIC_CONFIG_ENCRYPT_KEY = "ENCRYPT_KEY";
    public static final String DYNAMIC_CONFIG_HEADER_KEY = "DYNAMIC_CONFIG_MD5";
    public static final String DYNAMIC_CONFIG_AUTH_WHITE_LIST = "AUTH_WHITE_LIST";
    public static final String DYNAMIC_CONFIG_AUTH_ANONYMOUS = "AUTH_ANONYMOUS";
    public static final String DYNAMIC_CONFIG_AUTH_ADMIN_WHITE_LIST = "AUTH_ADMIN_WHITE_LIST";
    public static final String DYNAMIC_CONFIG_AUTH_USER_REG_MENU = "AUTH_USER_REG_MENU";

    public static final String WUPS_MODULE = "WUPS";
    public static final String WUPS_COMMON_SUBMODULE = "COMMON";
    public static final String WUPS_SERVERIPS_KEY = "SERVERIPS";
    public static final String WUPS_GLOBAL_SWITCH_KEY = "CANWRITE";
    public static final String WUPS_AUTH_CLEARALL = "WUPS_AUTH_CLEARALL";
    public static final String WUPS_MANAUL_SYNC_LDAP = "CAN_MANUAL_LDAP";

    public static final Integer WUPS_GROUP_MEMBER_RESOURCE = 1;
    public static final Integer WUPS_GROUP_MEMBER_ROLE = 2;
    public static final Integer WUPS_GROUP_MEMBER_USER = 3;

    /**
     * 默认redis tll(秒) 20分钟
     */
    public static final Integer DEFAULT_REDIS_EXPIRE = 60 * 20;

    /**
     * 短时间的缓存 5分钟
     */
    public static final Integer SHORT_REDIS_EXPIRE = 60 * 5;


    /**
     * 需要长时间缓存、不太变动的数据，如机构、岗位、应用等
     */
    public static final Integer LONG_REDIS_EXPIRE = 60 * 60 * 18;

    /**
     * 密码私钥
     */
    public static final String RSA_PRI_KEY = "MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEApV9kQgBeiK15ec7vrjRgmFbclwymVo4WZ57gcjG3gKASbVWIXTa14bnJCltXOSnblJ/QuIv29sJ9cNlxGpaVKQIDAQABAkEAkGInw6RU5RoofBwbkUozp+32rH6j3+AwWYoSRkF4CHjQ4sf+dZQvVPCbP5CEKVRuwUjH2eBlzUDiP+tnKvR3sQIhAOAm/ucwKd9TS/cbRtZDdaggnVXkoiJmY5ToVV914HutAiEAvN5sx4wX/yvO20wcHYU/DWlj8Q9tCrlHPQkJ5oMXLu0CIQC0cfAGAJnUtGOU+5pc5lWTER5XhQSYmMBVoWsIvAYIyQIgYOxEJqNeLTTuEtwcEYovsVJEV5DzBG3QgSICUqkzXIECIB3Y/temS0Fs1Yt2jQ9eLTU1TczzXTGOen3MSCvTCenI";


    public static final String RSA_PUB_KEY = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKVfZEIAXoiteXnO7640YJhW3JcMplaOFmee4HIxt4CgEm1ViF02teG5yQpbVzkp25Sf0LiL9vbCfXDZcRqWlSkCAwEAAQ==";


    public static final String LICENCE_SUBFIX = ".licence";
}
